package com.eastcom.collection.context


import com.eastcom.collection.timingtask.Task
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap


/**
 * Created by yuanyue on 2014-08-02.
 */
class TaskContext{
	//任务
	static List<String> taskPathList = new ArrayList()
	static Map<String,Task> taskMap = new ConcurrentHashMap<>()
	static Map<String,Object> taskConfig = new ConcurrentHashMap<>()
	static Map<String,String> taskRootPath = new ConcurrentHashMap<>()
	static void addTask(Task task) {
		taskMap.put(task.getJobId(),task)
	}

	static Task getTask(String id) {
		return taskMap.get(id)
	}

	static List<Task> getAllTask() {
		List taskList = new ArrayList()
		taskList.addAll(taskMap.values())
		return taskList
	}
}
